home *** CD-ROM | disk | FTP | other *** search
/ Cocktail Hour / image.iso / COCKTAIL.DIR / objects_23_prep script.ls < prev    next >
Encoding:
Text File  |  1997-03-05  |  12.3 KB  |  351 lines

  1. on exitFrame
  2.   global OnceCheck, CurrVideo, AfterFavorite, Choice, RecipeNum
  3.   if the visible of sprite 31 = 1 then
  4.     set the cursor of sprite 32 to 1
  5.   else
  6.     if the visible of sprite 31 = 0 then
  7.       set the cursor of sprite 32 to 0
  8.     end if
  9.   end if
  10.   if the type of member 200 of castLib "videos" = #digitalVideo then
  11.     set the cursor of sprite 17 to 0
  12.   end if
  13.   if OnceCheck = 0 then
  14.     cursor(-1)
  15.     set OnceCheck to 1
  16.     repeat with i = 4 to 6
  17.       set the cursor of sprite i to [34, 35]
  18.       set the cursor of sprite (i + 10) to [34, 35]
  19.     end repeat
  20.     set the cursor of sprite 3 to [34, 35]
  21.     set the cursor of sprite 35 to [34, 35]
  22.     if the visible of sprite 16 then
  23.       set the visible of sprite 16 to 0
  24.     end if
  25.     repeat with i = 19 to 29
  26.       if the visible of sprite i then
  27.         set the visible of sprite i to 0
  28.       end if
  29.     end repeat
  30.     repeat with i = 31 to 35
  31.       if the visible of sprite i then
  32.         set the visible of sprite i to 0
  33.       end if
  34.     end repeat
  35.     if the visible of sprite i then
  36.       set the visible of sprite 38 to 0
  37.     end if
  38.     if the visible of sprite i then
  39.       set the visible of sprite 37 to 0
  40.     end if
  41.     set CurrVideo to line RecipeNum of field "videoLib"
  42.     repeat with i = 3 to 8
  43.       puppetSprite(i, 1)
  44.     end repeat
  45.     set x to the number of lines in the text of member ("recipe" & RecipeNum)
  46.     set tarHow to line x - 3 of the text of member ("recipe" & RecipeNum)
  47.     if the name of member value(RecipeNum) of castLib "small picts" = "noPict" then
  48.       set the member of sprite 7 to member "mezze"
  49.     else
  50.       set the member of sprite 7 to member RecipeNum of castLib "small picts"
  51.     end if
  52.     puppetSprite(36, 1)
  53.     puppetSprite(17, 1)
  54.     set howVec to ["Long", "Short", "Shot", "Hot"]
  55.     set howShown to getPos(howVec, tarHow)
  56.     set the visible of sprite (25 + howShown) to 1
  57.     cursor(0)
  58.     set the visible of sprite 16 to 0
  59.     forget(window "notes")
  60.     windowRoutine()
  61.     if (CurrVideo <> " ") and (CurrVideo <> EMPTY) then
  62.       DoMovie(CurrVideo)
  63.     else
  64.       set the member of sprite 36 to member RecipeNum of castLib "slideNW"
  65.       set the visible of sprite 36 to 1
  66.       set the visible of sprite 17 to 0
  67.     end if
  68.     if (AfterFavorite = 0) and (CurrVideo <> " ") and (CurrVideo <> EMPTY) then
  69.       set the sound of member 200 of castLib "videos" to 0
  70.       set the movieRate of sprite 41 to 0.001
  71.     else
  72.       if line RecipeNum of field "names" <> "choice" then
  73.         set Choice to line RecipeNum of field "names"
  74.       end if
  75.     end if
  76.   end if
  77.   if (the timer > 120) and (OnceCheck = 1) and (AfterFavorite = 0) and (CurrVideo <> " ") and (CurrVideo <> EMPTY) and (the type of member 200 of castLib "videos" = #digitalVideo) then
  78.     set the movieRate of sprite 41 to 1
  79.     set the sound of member 200 of castLib "videos" to 1
  80.     set OnceCheck to 2
  81.   end if
  82.   go(the frame)
  83. end
  84.  
  85. on mouseDown
  86.   global checkPress, CurrVideo
  87.   set checkPress to the clickOn
  88.   set bDown to the clickOn
  89.   if (bDown > 2) and (bDown < 7) then
  90.     set the cursor of sprite 17 to [34, 35]
  91.     set the visible of sprite 36 to 0
  92.     if (CurrVideo = " ") or (CurrVideo = EMPTY) then
  93.       set the visible of sprite 17 to 1
  94.     end if
  95.     set the member of sprite bDown to member ("PrepBtn" & bDown - 2)
  96.   else
  97.     if bDown = 24 then
  98.       set the member of sprite 24 to member "shopDelete" of castLib "objects"
  99.     else
  100.       if bDown = 25 then
  101.         set the member of sprite 25 to member "shopClear" of castLib "objects"
  102.       else
  103.         if bDown > 41 then
  104.           buttonPressedDown(bDown, "objects")
  105.         end if
  106.       end if
  107.     end if
  108.   end if
  109.   updateStage()
  110.   if ((bDown > 2) and (bDown < 7)) or (bDown = 25) or (bDown = 24) or (bDown > 41) then
  111.     repeat while the mouseDown
  112.     end repeat
  113.     set the member of sprite bDown to member "origin"
  114.   end if
  115. end
  116.  
  117. on mouseUp
  118.   global checkPress, CurrVideo, Navigate, Choice, gRecNumber, goOn, gAdd, gProgrmPathOnHD, MyFavorites, AfterFavorite, current, RecipeNum
  119.   set the editable of member "CurrNotes" to 1
  120.   set checkPress2 to the clickOn
  121.   if checkPress = checkPress2 then
  122.     set bUp to the clickOn
  123.     if (bUp > 2) and (bUp < 7) then
  124.       set the member of sprite bUp to member "Origin"
  125.       if bUp = 3 then
  126.         set listToGoTo to EMPTY
  127.         set x to the number of lines in field "backField"
  128.         set currFrame to the frame - 1
  129.         if currFrame = 190 then
  130.           set Navigate to "abc"
  131.           set dest to "abc"
  132.           set the text of field "total" to the text of field "abc"
  133.         else
  134.           if currFrame = 180 then
  135.             set Navigate to "abc"
  136.             set dest to "abc"
  137.             set the text of field "total" to the text of field "abc"
  138.           else
  139.             if currFrame = 195 then
  140.               set Navigate to "partyDrinks"
  141.               set dest to "entertainment"
  142.             else
  143.               if currFrame = 175 then
  144.                 set Navigate to "abc"
  145.                 set dest to "abc"
  146.                 set the text of field "total" to the text of field "abc"
  147.               else
  148.                 if currFrame = 130 then
  149.                   set Navigate to "non-alco"
  150.                   set dest to "non-alco"
  151.                 else
  152.                   if currFrame = 125 then
  153.                     set Navigate to "abc"
  154.                     set dest to "abc"
  155.                     set the text of field "total" to the text of field "abc"
  156.                   else
  157.                     set Navigate to "alco"
  158.                     set alcoDest to line x - 1 of field "backField"
  159.                     set alcoDest to value(alcoDest)
  160.                   end if
  161.                 end if
  162.               end if
  163.             end if
  164.           end if
  165.         end if
  166.         if dest <> EMPTY then
  167.           put marker(0) into line x + 1 of field "backField"
  168.           clearPuppets()
  169.           if Navigate = "alco" then
  170.             go(alcoDest)
  171.           else
  172.             go(marker(dest))
  173.           end if
  174.         end if
  175.       else
  176.         if bUp = 4 then
  177.           DontMovie()
  178.           repeat with i = 19 to 25
  179.             set the visible of sprite i to 1
  180.             case i of
  181.               20, 21, 23, 24, 25:
  182.                 set the cursor of sprite i to [34, 35]
  183.             end case
  184.             set the cursor of sprite 13 to [34, 35]
  185.           end repeat
  186.           set the cursor of sprite 35 to [34, 35]
  187.           repeat with i = 34 to 35
  188.             set the visible of sprite i to 1
  189.           end repeat
  190.           repeat with i = 31 to 32
  191.             set the visible of sprite i to 0
  192.           end repeat
  193.           puppetSprite(24, 1)
  194.           puppetSprite(25, 1)
  195.           if (CurrVideo <> " ") and (CurrVideo <> EMPTY) then
  196.             set the visible of sprite 16 to 1
  197.           end if
  198.         else
  199.           if bUp = 5 then
  200.             DontMovie()
  201.             repeat with i = 19 to 25
  202.               set the visible of sprite i to 0
  203.               case i of
  204.                 20, 21, 23, 24, 25:
  205.                   set the cursor of sprite i to -1
  206.               end case
  207.             end repeat
  208.             set the cursor of sprite 13 to -1
  209.             repeat with i = 34 to 35
  210.               set the visible of sprite i to 0
  211.             end repeat
  212.             repeat with i = 31 to 33
  213.               set the visible of sprite i to 1
  214.             end repeat
  215.             puppetSprite(24, 0)
  216.             puppetSprite(25, 0)
  217.             set goOn to 1
  218.             set gRecNumber to RecipeNum
  219.             if (CurrVideo <> " ") and (CurrVideo <> EMPTY) then
  220.               set the visible of sprite 16 to 1
  221.             end if
  222.           else
  223.             if bUp = 6 then
  224.               DontMovie()
  225.               set gAdd to 1
  226.               if the stageRight > 640 then
  227.                 set winRect to rect(318, 172, 716, 494)
  228.               else
  229.                 set winRect to rect(238, 111, 634, 431)
  230.               end if
  231.               set the modal of window "favorite" to 1
  232.               set the titleVisible of window "favorite" to 0
  233.               set the windowType of window "favorite" to 3
  234.               set the rect of window "favorite" to winRect
  235.               set the fileName of window "favorite" to gProgrmPathOnHD & "favorite.dir"
  236.               if the visible of sprite 16 then
  237.                 set the visible of sprite 16 to 0
  238.               end if
  239.               repeat with i = 19 to 29
  240.                 if the visible of sprite i then
  241.                   set the visible of sprite i to 0
  242.                 end if
  243.               end repeat
  244.               repeat with i = 31 to 35
  245.                 if the visible of sprite i then
  246.                   set the visible of sprite i to 0
  247.                 end if
  248.               end repeat
  249.               if the visible of sprite i then
  250.                 set the visible of sprite 38 to 0
  251.               end if
  252.               if the visible of sprite i then
  253.                 set the visible of sprite 37 to 0
  254.               end if
  255.               set AfterFavorite to 1
  256.               set MyFavorites to 0
  257.               set current to []
  258.               add(current, RecipeNum)
  259.               windowRoutine()
  260.               set x to field "currNotes"
  261.               tell window "notes"
  262.                 set the text of field (RecipeNum + 50) to x
  263.               end tell
  264.               tell window "notes"
  265.                 saveMovie()
  266.               end tell
  267.               open(window "favorite")
  268.             end if
  269.           end if
  270.         end if
  271.       end if
  272.     else
  273.       if bUp = 17 then
  274.         if the type of member 200 of castLib "videos" <> #digitalVideo then
  275.           set the member of sprite 36 to member RecipeNum of castLib "slideNW"
  276.           set the editable of member "CurrNotes" to 0
  277.           repeat with i = 19 to 29
  278.             set the visible of sprite i to 0
  279.           end repeat
  280.           repeat with i = 31 to 35
  281.             set the visible of sprite i to 0
  282.           end repeat
  283.           set the visible of sprite 38 to 0
  284.           set the visible of sprite 37 to 0
  285.           set the visible of sprite 36 to 1
  286.         end if
  287.       else
  288.         if bUp = 24 then
  289.           set the member of sprite 24 to member "origin"
  290.           set lastLine to the number of lines in field "shop2"
  291.           set i to 1
  292.           repeat with j = 1 to lastLine
  293.             if the foreColor of line i of field "shop2" = 35 then
  294.               delete line i of field "shop2"
  295.               delete line i of field "shop1"
  296.               next repeat
  297.             end if
  298.             set i to i + 1
  299.           end repeat
  300.           set the foreColor of field "shop1temp" to 204
  301.           set the foreColor of field "shop2temp" to 204
  302.           set the text of field "shop1temp" to line 1 to 10 of field "shop1"
  303.           set the text of field "shop2temp" to line 1 to 10 of field "shop2"
  304.         else
  305.           if bUp = 25 then
  306.             set the member of sprite 25 to member "origin"
  307.             set the foreColor of field "shop1" to 204
  308.             set the foreColor of field "shop2" to 204
  309.             set the foreColor of field "shop1temp" to 204
  310.             set the foreColor of field "shop2temp" to 204
  311.             set the text of field "shop1" to EMPTY
  312.             set the text of field "shop2" to EMPTY
  313.             set the text of field "shop1temp" to EMPTY
  314.             set the text of field "shop2temp" to EMPTY
  315.           else
  316.             if bUp > 41 then
  317.               if bUp = 44 then
  318.                 set x to the number of lines in field "backField"
  319.                 set the text of field "backField" to line 1 to x - 1 of field "BackField"
  320.               else
  321.                 if bUp = 48 then
  322.                   if the visible of sprite 16 then
  323.                     set the visible of sprite 16 to 0
  324.                   end if
  325.                   repeat with i = 19 to 29
  326.                     if the visible of sprite i then
  327.                       set the visible of sprite i to 0
  328.                     end if
  329.                   end repeat
  330.                   repeat with i = 31 to 35
  331.                     if the visible of sprite i then
  332.                       set the visible of sprite i to 0
  333.                     end if
  334.                   end repeat
  335.                   if the visible of sprite i then
  336.                     set the visible of sprite 38 to 0
  337.                   end if
  338.                   if the visible of sprite i then
  339.                     set the visible of sprite 37 to 0
  340.                   end if
  341.                 end if
  342.               end if
  343.               buttonPressedUp(bUp, "objects")
  344.             end if
  345.           end if
  346.         end if
  347.       end if
  348.     end if
  349.   end if
  350. end
  351.